package com.hnyfkj.jyindustry;

import javafx.beans.binding.Bindings;
import javafx.beans.property.DoubleProperty;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.stage.Screen;

import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class SwingDemo {

    public static void main(String[] args) throws IOException {

        getVideo();
    }

    public static void getVideo() throws IOException {


        URL url = new URL("http://222.133.14.246:19091//hnyfkj-file-server/plugins/im/mp4/20210603/131.mp4");
        URLConnection con = url.openConnection();
        FileOutputStream out = new FileOutputStream("F:/1111111111111111.mp4");
        InputStream ins = con.getInputStream();
        byte[] b = new byte[1024];
        int i=0;
        while((i=ins.read(b))!=-1){
            out.write(b, 0, i);
        }
        ins.close();
        out.close();

    }


}